package com.xxl.rpc.sample.server.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xxl.rpc.sample.api.DemoService;
import com.xxl.rpc.sample.server.conf.XxlJobDynamicScheduler;

/**
 * jetty访问的路径
 * 
 * @author Administrator
 *
 */
@Controller
public class JobApiController {

	/**
	 * 远程执行的时候要调用的
	 * 
	 * @param request
	 * @param response
	 * @throws IOException
	 * @throws ServletException
	 */
	@RequestMapping(DemoService.MAPPING)
	public void api(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		XxlJobDynamicScheduler.invokeAdminService(request, response);
	}

}
